
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
	<title>可用可信家庭市场</title>
	<!--                       CSS                       -->
	<!-- Reset Stylesheet -->
	<link rel="stylesheet" href="/static/css/reset.css" type="text/css" media="screen" />
	<!-- Main Stylesheet -->
	<link rel="stylesheet" href="/static/css/style.css" type="text/css" media="screen" />
	<!-- Invalid Stylesheet. This makes stuff look pretty. Remove it if you want the CSS completely valid -->
	<link rel="stylesheet" href="/static/css/invalid.css" type="text/css" media="screen" />
	<!--                       Javascripts                       -->
	<!-- jQuery -->
	<script type="text/javascript" src="/static/scripts/jquery-1.3.2.min.js"></script>
	<!-- jQuery Configuration -->
	<script type="text/javascript" src="/static/scripts/simpla.jquery.configuration.js"></script>
	<!-- Facebox jQuery Plugin -->
	<script type="text/javascript" src="/static/scripts/facebox.js"></script>
	<!-- jQuery WYSIWYG Plugin -->
	<script type="text/javascript" src="/static/scripts/jquery.wysiwyg.js"></script>
	<!-- jQuery Datepicker Plugin -->
	<script type="text/javascript" src="/static/scripts/jquery.datePicker.js"></script>
	<script type="text/javascript" src="/static/scripts/jquery.date.js"></script>
	<!-- jQuery -->
	<link rel="stylesheet" type="text/css" media="all" href="/static/css/motai.css">
	<script type="text/javascript" src="/static/js/jquery-1.9.1.min.js"></script>
	<script type="text/javascript" charset="utf-8" src="/static/js/jquery.leanModal.min.js"></script>
	<style>
		body{
			font-family:微软雅黑;
		}
		#cgmain {width:100%;background-color:#f3ccf3;}
		.alltable{width: 640px;text-align:center;/*min-height:500px;*/margin-top:10px;background-color:#f3ccf3;float: left;margin: 10px;padding: 10px;}
		.pihao_ul{
			list-style:none;
			border:hidden;
			
		}
		.pihao_ul li {
			float:left;
			line-height:13px;
			font-size:13px;
			list-style-type:none;
		}
		.price_ul{
			list-style:none;
			border:hidden;
		}
		.price_ul li {
			float:left;
			line-height:10px;
			font-size:13px;
			list-style-type:none;
			
		}


		.cm {width:100px;}
		.bj {width:80px;}
		.gg {width:120px;}
		.sl {width:80px;}
		.bz {width:200px;}
		
		.table-b {
			width:600px;
			margin-left:10px;
			border-width: 1px;
			border-color: #a9c6c9;
			border-collapse: collapse;
			font-size:10px;
			}

		.table-b th{
			border-width: 1px;
			padding: 8px;
			border-style: solid;
			border-color: #000;
			line-height:10px;
		}
		.td{
			line-height:5px;
		}
		.table-b td{
			border-width: 1px;
			padding:0 0 0 8px;
			line-height: 20px;
			border-style: solid;
			border-color: #000;
			font-size: 1em;
		}

		.columnps{
			width:100%;
			font-size:12px;
/*			column-count:2;
			column-gap:1em;*/
		}
		.clear{clear: both;}
		.trs td{padding: 8px;}
		.zhifu{
			width:100px;
			float:right;
			margin-right:58px;
			padding-top:15px;
		}
		.yifu{
			float:left;
			width:12px;
			height:12px;
			border:1px solid black;
		}
		.yifucn{
			float:left;
			font-size:12px;
			line-height:15px;
			margin-right:2px;
		}
		.dayin{
			width:150px;
			height:40px;
			border:1px solid palevioletred;
			margin-bottom:30px;
			margin-left:10px;
			float: left;
		
			text-align:center;
			line-height:40px;
		}
		.dayin a{
			font-size:16px;
			text-decoration:none;
			color:#000;
		}
		.dayin_hover{background:#EEB4B4;}
		.dayin_no{float:left;background-color:#fce0ee;border:1px solid #EEA2AD;}
		.dayin_no:hover{background-color:#EEB4B4;}	
		.dayin_yes{float:left;background-color:#DDA0DD;border:1px solid #D15FEE;}
		.dayin_yes:hover{background-color:#D15FEE;}
	</style>
</head>
<body>
<div id="body-wrapper">
	<!-- Wrapper for the radial gradient background -->
	<div id="sidebar">
		<div id="sidebar-wrapper">

			<div id="profile-links">
				<!-- Logo (221px wide) -->
				<a href="#"><img id="logo" src="/static/images/logo.png" alt="Simpla Admin logo" /></a>

				{$_COOKIE['user_name']},你好 <br/>
				| <a href="/index.php/index/index/uexit" title="Sign Out">退出</a> </div>

			 <ul id="main-nav">
                <!-- Accordion Menu -->
                <!--<li> <a href="#/" class="nav-top-item no-submenu">-->
                    <!--&lt;!&ndash; Add the class "no-submenu" to menu items with no sub menu &ndash;&gt;-->
                    <!--Dashboard </a> </li>-->
                {if condition="!empty($powers['order_action'])"}
                <li> <a href="#" class="nav-top-item current"> 订单操作</a>
                    <ul>
                    	
                        <li><a class="current" href="/index.php/index/index/neworder_list">新订单</a></li>
                        <!-- Add class "current" to sub menu items also -->
                        <li><a href="/index.php/index/index/addorder">创建新订单</a></li>
                        <li><a href="/index.php/index/index/allorder_list">所有订单</a></li>
                    </ul>
                </li>
           	{/if}
           	 {if condition="!empty($powers['cg_action'])"}
                <li> <a href="#" class="nav-top-item"> 采购单 </a>
                    <ul>
                        <li><a href="/index.php/index/index/newcg_list">待处理 采购单</a></li>
                        <li><a href="/index.php/index/index/cg_history">采购单历史</a></li>
                    </ul>
                </li>
             {/if}
              {if condition="!empty($powers['table_action'])"}
                <li> <a href="#" class="nav-top-item"> 报表 </a>
                    <ul>
                        <li><a href="/index.php/index/biao/daybiao">日报表</a></li>
                        <li><a href="/index.php/index/biao/yuebiao">月报表</a></li>
                        <li><a href="/index.php/index/biao/nianbiao">年报表</a></li>
                    </ul>
                </li>
               {/if}
                {if condition="!empty($powers['goods_action'])"}
                <li> <a href="#" class="nav-top-item">菜品管理 </a>
                    <ul>
                        <li><a href="/index.php/index/goods/goods">所有菜品</a></li>
                        <li><a href="/index.php/index/goods/categorys">所有分类</a></li>
                    </ul>
                </li>
                {/if}
                 {if condition="!empty($powers['promotion_action'])"}
                 <li> <a href="#" class="nav-top-item"> 推广活动 </a>
                    <ul>
                        <li><a href="/index.php/index/promotion/snlist">SN优惠码</a></li>
                    </ul>
                </li>
                {/if}
                
                <li> <a href="#" class="nav-top-item"> 个人信息 </a>
                    <ul>
                        <li><a href="/index.php/index/index/user_info">查看信息</a></li>
                        <li><a href="/index.php/index/index/update_pass">修改密码</a></li>
                    </ul>
                </li>
       
                {if condition="!empty($powers['super'])"}
                 <li><a href="#" class="nav-top-item"> 用户管理 </a>
                 	<ul>
                        <li><a href="/index.php/index/admin/user_admin">用户权限</a></li>
                    </ul>
                 </li>
                {/if}

            </ul>
            <!-- End #main-nav -->

		</div>
	</div>
	<!-- End #sidebar -->
	<div id="main-content">
		<!-- Main Content Section with everything -->


		<!--tiles start-->
		<div class="row">
            <div class="big">
                <a href="/index.php/index/index/neworder_list">
                <div class="dashboard-tile detail tile-red">
                    <br/>
                    <p>
                    <font style="font-size:40px;" id="message_tips">0</font><br/><br/><br/>
                        <font style="font-size:25px;">待处理 新订单</font>
                    </p>
                </div>
                    </a>
            </div>
            <div class="big"  style="margin-left:20px;">
                <a href="/index.php/index/index/newcg_list">
                <div class="dashboard-tile detail tile-turquoise">
                    <br/>
                        <p>
                            <font style="font-size:40px;">{$cgcount}</font><br/><br/><br/>
                            <font style="font-size:25px;">待处理 采购单</font>
                        </p>
                </div>
                    </a>
            </div>
            <div class="big" style="margin-left:20px;">
                <a href="/index.php/index/index/ps_list">
                <div class="dashboard-tile detail tile-purple" >
                    <br/>
                    <p>
                        <font style="font-size:40px;">{$pscount}</font><br/><br/><br/>
                        <font style="font-size:25px;">待处理 配送单</font>
                    </p>
                </div>
                </a>
            </div>
        </div>
		<!--tiles end-->
		<!-- End .shortcut-buttons-set -->
		<div class="clear"></div>
		<!-- End .clear -->
		<div class="dayin"><a href="/index.php/index/index/ps_list/dayin/no">未打印配送单</a></div>
		<div class="dayin dayin_hover"><a href="/index.php/index/index/ps_list/dayin/yes">已打印配送单</a></div>
		
		<div class="content-box" style="margin-top:42px;border:1px solid #D15FEE;">
			<!-- Start Content Box -->
			<div class="content-box-header" >
        
			</div>
			<!-- End .content-box-header -->
			<div class="content-box-content columnps">
				<?php $sss=0;?>
				{volist name="dayin_yes" id="dv" key="dk" }
			{volist name="dv" id="v" key="k" }	
				<?php $k1=$key;?>
					<?php $sss=$sss+1;?>
			<div class="alltable" id="{$v.order_id}">
				<div style="width:600px;" >
					<a href="/index.php/index/index/update_order/order_id/{$v.order_id}/dayin/yes" style="color:white;"><button type="button" class="button_red">修改</button></a>
					<a href="/index.php/index/index/select_psy/order_id/{$v.order_id}/dayin/yes" style="color:white;"><button type="button" class="button_red">指定派送员</button></a>&nbsp;&nbsp;
{if condition="!empty($v.deliver_uid)"}
	<a style="color:brown;" onClick="startps({$v.deliver_uid},{$v.order_id})" ><i class="glyphicon"></i>开始配送 >></a>
{else/}需指定配送员才能开始配送
{/if}
					
					<button type="button" style="margin-left:130px;" onclick="printPage({$sss},'{$v.order_id}')"  class="button medium back"  data-am-modal="{target: '#doc-modal-1', closeViaDimmer: 0, width: 400, height: 225}">A4纸打印</button>
					<a href="/index.php/index/index/printps/order_id/{$v.order_id}" style="margin-left:5px;" class="button medium back">超市小票纸打印</a>
								
				</div>

				<!--startprint{$sss}-->
				<div id="cgmain">
					<div class="cgdiv">
						<div style="height:20px;font-size:20px;text-align:center;line-height:20px;">
							配送单
							<div class="zhifu">
								<div class="yifucn">
								已付
								</div>
								<div class="yifu"></div>
							</div>
						</div>
						<ul class="pihao_ul" >
											<li style="width:150px;line-height:13px;float:left;">可用可信家庭市场</li>
											<li style="width:100px;line-height:13px;">订单号:{$v.order_id}</li>
											<li style="width:180px;line-height:13px;">配送日期: 
												{if condition="!empty($v['ps_date'])"}
													{$v.ps_date|date='Y-m-d',###}
												{else/}
													{$v.create_time|date='Y-m-d',###}
												{/if}
											</li>
											<li style="width:150px;line-height:13px;">配送时间:
												{if condition="!empty($v.desc_time)"}
													{$v.desc_time}
												{else/}
													{if condition="($v.ps_time == 9)"}9:00-10:00
													{elseif condition="$v.ps_time == 10"}10:00-11:00
													{elseif condition="$v.ps_time == 11"}11:00-12:00
		
													{elseif condition="$v.ps_time == 15"}15:00-16:00
													{elseif condition="$v.ps_time == 16"}16:00-17:00
													{elseif condition="$v.ps_time == 17"}17:00-18:00
													{else /}
													{/if}
												{/if}
											</li>
											<div style="clear: both;"></div>
						</ul>
					</div>
					<table class="table-b">
						<thead>
						<tr class="trr">
							<th class="cm">菜单名</th>
							<th class="sl">数量规格</th>
							<!--<th class="gg">规格</th>-->
							<th class="bj">单价</th>
							<th class="bj">金额</th>
							
						</tr>
						</thead>
						<tbody>
						{if condition="!empty($v['menu'])"}
						{volist name="v['menu']" id="vo" key="kk" }

						<tr class="trr">

							<td class="td">{$vo.name}</td>
							<td class="td">{$vo.num}/{$vo.guige}</td>
							<!--<td class="td">
								{$vo.guige}
							</td>-->
							<td class="td">{$vo.price}</td>
							<td class="td">
								{$vo.allprice}
							</td>
							{/volist}
							{/if}
						</tr>
						<tr class="trs" >
							<td style="line-height:15px;" colspan="2">
								收货人：{$v.address_info.name}  <br/> 
								电话：{$v.address_info.phone} <br/> 
								<span>地址：{$v.address_info.address}{$v.address_info.detail}</span> 
								{if condition="!empty($v['discount'])"}
								优惠：{$v['discount']->desc}&nbsp;{$v['discount']->discount_money}
								{/if}
							</td>
							<td style="line-height:15px;"colspan="4">
								顾客备注：{$v.desc}<br/>
								商家备注：{$v.store_desc}
							</td>
						</tr>

						</tbody>
					</table>

						<div class="price_ul" style="margin-top:-1px;">
							<ul>
						<li style="width:15%;line-height:8px;">原价: {$v.price}</li>
						<li style="width:15%;line-height:8px;">应收: {$v.discount_price}</li>
						<li style="width:20%;line-height:8px;">实收: {$v.online_pay}&nbsp;
						{if condition="$v['pay_type'] eq 'offline'" }
						(线下)
						{elseif condition="$v['pay_type'] eq 'weixin'" }
						(微信)
						{/if}
						</li>
	
						<li style="margin-left:30px;width:17%;line-height:8px;">配送员：
						{if condition="$v['deliver_user'] neq ''" }
							
							{$v['deliver_user']}
							
						{else /}
						{/if}
						</li>
						<li style="margin-left:5%;line-height:8px;">
						客户签名:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;
						</li>
							</ul>	
						</div>

				</div>
				<!--endprint{$sss}-->	
			</div>
<!--			<br/><br/>-->
			{/volist}
				{/volist}
				<div class="clear"></div>
			</div>
			<!-- End #tab1 -->

			<!-- End #tab2 -->


		</div>
		<!-- End .content-box-content -->
	</div>
	<!-- End .content-box -->



</div>
<!-- End #main-content -->
</div>

<script src="http://cdn.bootcss.com/jquery/3.1.0/jquery.min.js"></script>
<script src="http://cdn.bootcss.com/amazeui/2.7.2/js/amazeui.min.js"></script>

<script src="./tpl/Hm/default/static/order/js/jquery-1.7.1.js" type="text/javascript"></script>
<script>
targeturl({$target});
	function targeturl(t){
		if(t!='0'){
			location.href="#"+t;
			$('#'+t).css({border:'3px solid #6959CD'});
		}
	}
	function printPage(key)
	{
		var bdhtml=window.document.body.innerHTML;//获取当前页面html代码
		var sprnstr= "<!--startprint"+key+"-->" ;
		var eprnstr= "<!--endprint"+key+"-->" ;
		var prnhtml=bdhtml.substring(bdhtml.indexOf(sprnstr)+18);
		prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));
		window.document.body.innerHTML=prnhtml;
		window.print();
		window.document.body.innerHTML=bdhtml;


	}

	function reids(orderid){
		$('#orderid').val(orderid);
	}
	message_tips();
	/**
	 * ajax提醒
	 **/
	a = 1;
	function fn(){

		if(a == 1){
			$('#message_tips').css({color:'white'});
			$('#message_tips2').css({color:'white'});
			a = 0;
		}else{
			$('#message_tips').css({color:'#b9df70'});
			$('#message_tips2').css({color:'#b9df70'});
			a = 1;
		}
	}
	var myInterval;
	function message_tips(){
		$.get("/index.php/index/index/tips", function(data){
			if(data != $('#message_tips').html()){
				$('#message_tips').css({color:'#b9df70'});
				myInterval = setInterval(fn,5000);
				$('#message_tips2').css({color:'#b9df70'});
				$("#message_audio").html("<audio id='ttsoundplayer'  autoplay='autoplay'><source src='/static/sound/1583.wav' type='audio/wav'></audio>");

			} else {
				$("#message_audio").html('');
				if(data == 0){
					$('#message_tips').css({color:'white'});
					clearInterval(myInterval);
				}
			}

			$('#message_tips').html(data);
			$('#message_tips2').html(data);
		},'json');
		setTimeout('message_tips()',10000);
	}

 function startps(uid,order_id)
    {
    	if(uid == 0){
    		alert("配送失败，你还没有指定派送员哦！");
    		return false;
    	}else{
    		location.href="/index.php/index/index/ps_start/order_id/"+order_id;
    		alert("配送成功，订单正在派送中");
    		return true;
    	}
       
    }
</script>
</body>
</html>
